import request from '@/utils/request'

const api_name = '/admin/product';

export default {
    getCategory1() {
        return request.get(`${api_name}/getCategory1`);
    },

    getCategory2(category1Id) {
        return request.get(`${api_name}/getCategory2/${category1Id}`);
    },

    getCategory3(category2Id) {
        return request.get(`${api_name}/getCategory3/${category2Id}`);
    },

    getAttrs(category1Id,category2Id,category3Id) {
        return request.get(`${api_name}/attrInfoList/${category1Id}/${category2Id}/${category3Id}`);
    },

    // 根据attrId删除对应的属性
    delAttrById(attrId) {
        return request.delete(`${api_name}/deleteAttr/${attrId}`);
    },

    // 新增&修改接口
    addOrUpdateArr(attr) {
        return request.post(`${api_name}/saveAttrInfo`,attr);
    }

}

